```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tomcat 内存泄漏检测与调优指南 | 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-bg {
            background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
        }
        .section-title {
            position: relative;
            padding-bottom: 0.5rem;
        }
        .section-title:after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 60px;
            height: 3px;
            background: #3498db;
        }
        .code-block {
            background: #f5f7fa;
            border-left: 4px solid #3498db;
            transition: all 0.3s ease;
        }
        .code-block:hover {
            background: #ebf4ff;
        }
        .card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col items-center text-center">
                <h1 class="text-4xl md:text-6xl font-bold mb-6 animate-fade-in-up">
                    Tomcat 内存泄漏检测与调优
                </h1>
                <p class="text-xl md:text-2xl mb-8 max-w-3xl opacity-90">
                    全面指南：从检测到预防，保障应用稳定运行的实用策略
                </p>
                <div class="flex space-x-4">
                    <a href="#detection" class="btn-primary px-6 py-3 rounded-lg bg-blue-500 hover:bg-blue-600 transition duration-300 inline-flex items-center">
                        <i class="fas fa-search mr-2"></i> 检测方法
                    </a>
                    <a href="#optimization" class="btn-outline px-6 py-3 rounded-lg border-2 border-white hover:bg-white hover:text-blue-800 transition duration-300 inline-flex items-center">
                        <i class="fas fa-cog mr-2"></i> 调优策略
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-4">
        <div class="container mx-auto max-w-5xl">
            <div class="bg-white rounded-xl shadow-md p-8 md:p-10">
                <div class="flex items-center mb-6">
                    <div class="bg-blue-100 p-3 rounded-full mr-4">
                        <i class="fas fa-exclamation-triangle text-blue-600 text-xl"></i>
                    </div>
                    <h2 class="text-2xl font-bold text-gray-800">内存泄漏的影响</h2>
                </div>
                <p class="text-gray-700 mb-6">
                    内存泄漏指的是程序在运行过程中未能正确释放不再使用的内存，导致内存不断增加，最终可能引发应用崩溃或性能下降。在Tomcat环境中，内存泄漏会直接影响应用的稳定性和响应能力，甚至导致服务不可用。
                </p>
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                    <div class="bg-red-50 p-4 rounded-lg border-l-4 border-red-500">
                        <h3 class="font-semibold text-red-700 mb-2"><i class="fas fa-bolt mr-2"></i>性能下降</h3>
                        <p class="text-sm text-red-600">响应时间变长，吞吐量降低</p>
                    </div>
                    <div class="bg-yellow-50 p-4 rounded-lg border-l-4 border-yellow-500">
                        <h3 class="font-semibold text-yellow-700 mb-2"><i class="fas fa-server mr-2"></i>资源耗尽</h3>
                        <p class="text-sm text-yellow-600">内存使用率持续升高</p>
                    </div>
                    <div class="bg-purple-50 p-4 rounded-lg border-l-4 border-purple-500">
                        <h3 class="font-semibold text-purple-700 mb-2"><i class="fas fa-times-circle mr-2"></i>服务崩溃</h3>
                        <p class="text-sm text-purple-600">OutOfMemoryError导致服务中断</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Detection Strategies Section -->
    <section id="detection" class="py-16 px-4 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <div class="mb-12">
                <h2 class="section-title text-3xl font-bold text-gray-800 mb-2">1. 内存泄漏检测策略</h2>
                <p class="text-gray-600">通过多种工具和方法识别和定位内存泄漏问题</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <!-- JVM内置工具 -->
                <div class="card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-blue-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-tools text-blue-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">1.1 使用 JVM 内置工具</h3>
                        </div>
                        <div class="space-y-4">
                            <div class="bg-blue-50 p-4 rounded-lg">
                                <h4 class="font-medium text-blue-700 mb-2"><i class="fas fa-desktop mr-2"></i> JVisualVM</h4>
                                <p class="text-sm text-gray-700 mb-2">图形化工具，用于分析堆内存使用情况、监控垃圾回收、查找内存泄漏等。</p>
                                <ul class="text-xs text-gray-600 space-y-1 pl-5 list-disc">
                                    <li>查看内存堆快照</li>
                                    <li>分析堆转储</li>
                                    <li>监控内存使用情况</li>
                                </ul>
                            </div>
                            <div class="bg-green-50 p-4 rounded-lg">
                                <h4 class="font-medium text-green-700 mb-2"><i class="fas fa-chart-line mr-2"></i> JConsole</h4>
                                <p class="text-sm text-gray-700 mb-2">图形化工具，用于监控 JVM 的运行时性能，包括内存使用情况。</p>
                                <ul class="text-xs text-gray-600 space-y-1 pl-5 list-disc">
                                    <li>实时监控内存、线程、类加载</li>
                                    <li>查看垃圾回收日志</li>
                                    <li>低开销的监控方式</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 专业工具 -->
                <div class="card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-purple-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-microscope text-purple-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">1.2 专业的内存分析工具</h3>
                        </div>
                        <div class="space-y-4">
                            <div class="bg-purple-50 p-4 rounded-lg">
                                <h4 class="font-medium text-purple-700 mb-2"><i class="fas fa-cubes mr-2"></i> Eclipse MAT</h4>
                                <p class="text-sm text-gray-700 mb-2">强大的内存分析工具，适用于分析 Java 堆转储。</p>
                                <ul class="text-xs text-gray-600 space-y-1 pl-5 list-disc">
                                    <li>检测和分析内存泄漏</li>
                                    <li>查找占用内存的对象</li>
                                    <li>分析对象引用关系</li>
                                </ul>
                            </div>
                            <div class="bg-yellow-50 p-4 rounded-lg">
                                <h4 class="font-medium text-yellow-700 mb-2"><i class="fas fa-chart-pie mr-2"></i> YourKit</h4>
                                <p class="text-sm text-gray-700 mb-2">商业化的 Java 性能分析工具，提供详细的内存和性能分析。</p>
                                <ul class="text-xs text-gray-600 space-y-1 pl-5 list-disc">
                                    <li>详细的内存泄漏分析</li>
                                    <li>性能分析</li>
                                    <li>线程分析</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Heap Dump -->
            <div class="mt-8 card bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="bg-red-100 p-2 rounded-lg mr-4">
                            <i class="fas fa-database text-red-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-gray-800">1.3 生成和分析 Heap Dump</h3>
                    </div>
                    <p class="text-gray-700 mb-4">
                        Heap Dump 是 JVM 的堆转储文件，可以用来分析内存的详细使用情况。生成和分析 Heap Dump 是定位内存泄漏的关键步骤。
                    </p>
                    
                    <div class="bg-gray-100 p-4 rounded-lg mb-4">
                        <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-terminal mr-2"></i> 生成 Heap Dump 命令</h4>
                        <div class="code-block p-4 rounded-md mb-3">
                            <code class="text-sm text-gray-800 font-mono">jmap -dump:format=b,file=heapdump.hprof &lt;pid&gt;</code>
                        </div>
                        <p class="text-xs text-gray-600">通过 jmap 命令生成堆转储文件，然后使用 Eclipse MAT 等工具进行分析。</p>
                    </div>
                    
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div class="bg-blue-50 p-3 rounded-lg">
                            <h4 class="font-medium text-blue-700 text-sm mb-1"><i class="fas fa-file-export mr-1"></i> 生成方式</h4>
                            <p class="text-xs text-gray-700">通过 JVM 参数或工具生成堆转储</p>
                        </div>
                        <div class="bg-green-50 p-3 rounded-lg">
                            <h4 class="font-medium text-green-700 text-sm mb-1"><i class="fas fa-search mr-1"></i> 分析方法</h4>
                            <p class="text-xs text-gray-700">使用内存分析工具解析堆转储</p>
                        </div>
                        <div class="bg-purple-50 p-3 rounded-lg">
                            <h4 class="font-medium text-purple-700 text-sm mb-1"><i class="fas fa-bug mr-1"></i> 常见问题</h4>
                            <p class="text-xs text-gray-700">查找内存泄漏和高占用的对象</p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Visualization -->
            <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden p-6">
                <h3 class="text-xl font-semibold text-gray-800 mb-4">内存泄漏检测工具对比</h3>
                <div class="mermaid">
                    graph TD
                    A[内存泄漏检测] --> B[JVM内置工具]
                    A --> C[专业分析工具]
                    B --> D[JVisualVM]
                    B --> E[JConsole]
                    C --> F[Eclipse MAT]
                    C --> G[YourKit]
                    D --> H[图形化界面]
                    D --> I[堆快照分析]
                    E --> J[实时监控]
                    F --> K[堆转储分析]
                    G --> L[商业解决方案]
                </div>
            </div>
        </div>
    </section>

    <!-- Optimization Strategies Section -->
    <section id="optimization" class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-5xl">
            <div class="mb-12">
                <h2 class="section-title text-3xl font-bold text-gray-800 mb-2">2. 内存泄漏调优策略</h2>
                <p class="text-gray-600">通过配置优化和最佳实践预防和解决内存泄漏问题</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <!-- 优化代码 -->
                <div class="card bg-blue-50 rounded-xl overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-blue-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-code text-blue-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">2.1 优化代码和资源管理</h3>
                        </div>
                        <div class="space-y-4">
                            <div class="bg-white p-4 rounded-lg shadow-sm">
                                <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-plug mr-2"></i> 关闭资源</h4>
                                <p class="text-sm text-gray-700">确保数据库连接、文件流、网络连接等资源在使用后及时关闭。</p>
                            </div>
                            <div class="bg-white p-4 rounded-lg shadow-sm">
                                <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-boxes mr-2"></i> 使用适当的数据结构</h4>
                                <p class="text-sm text-gray-700">选择合适的数据结构，避免内存浪费。</p>
                            </div>
                            <div class="bg-white p-4 rounded-lg shadow-sm">
                                <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-ban mr-2"></i> 避免静态集合</h4>
                                <p class="text-sm text-gray-700">静态集合（如 static List 或 Map）可能导致内存泄漏，因其生命周期与应用一致。</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 配置Tomcat -->
                <div class="card bg-green-50 rounded-xl overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-green-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-server text-green-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">2.2 配置 Tomcat 的内存参数</h3>
                        </div>
                        <div class="space-y-4">
                            <div class="bg-white p-4 rounded-lg shadow-sm">
                                <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-memory mr-2"></i> 堆内存设置</h4>
                                <p class="text-sm text-gray-700 mb-2">合理配置 JVM 堆内存的初始值和最大值。</p>
                                <div class="code-block p-3 rounded-md">
                                    <code class="text-sm text-gray-800 font-mono">-Xms512m -Xmx2g</code>
                                </div>
                            </div>
                            <div class="bg-white p-4 rounded-lg shadow-sm">
                                <h4 class="font-medium text-gray-800 mb-2"><i class="fas fa-recycle mr-2"></i> 垃圾回收参数</h4>
                                <p class="text-sm text-gray-700 mb-2">根据应用需求配置合适的垃圾回收器和参数。</p>
                                <div class="code-block p-3 rounded-md">
                                    <code class="text-sm text-gray-800 font-mono">-XX:+UseG1GC</code>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 更多调优策略 -->
            <div class="mt-8 grid grid-cols-1 md:grid-cols-2 gap-8">
                <div class="card bg-purple-50 rounded-xl overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-purple-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-cogs text-purple-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">2.3 配置 Tomcat 的内存管理</h3>
                        </div>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>调整 Tomcat 线程池大小，避免线程池过大导致内存使用过多</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>配置连接超时和空闲超时，避免因连接长时间未使用而导致的资源浪费</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                                <span>限制文件上传大小，防止大文件占用过多内存</span>
                            </li>
                        </ul>
                    </div>
                </div>

                <div class="card bg-yellow-50 rounded-xl overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-yellow-100 p-2 rounded-lg mr-4">
                                <i class="fas fa-calendar-check text-yellow-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">2.4 定期检查和清理</h3>
                        </div>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-yellow-500 mt-1 mr-2"></i>
                                <span>定期监控内存使用情况和垃圾回收日志，及时发现和解决潜在问题</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-yellow-500 mt-1 mr-2"></i>
                                <span>保持 Tomcat 和应用程序的依赖库更新到最新版本，修复已知的内存泄漏问题</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-yellow-500 mt-1 mr-2"></i>
                                <span>定期重启长时间运行的 Tomcat 实例，释放积累的内存</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Prevention Section -->
    <section class="py-16 px-4 bg-gray-50">
        <div class="container mx-auto max-w-5xl">
            <div class="mb-12">
                <h2 class="section-title text-3xl font-bold text-gray-800 mb-2">3. 如何防止内存泄漏</h2>
                <p class="text-gray-600">通过良好的编码规范和实践避免内存泄漏的发生</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                <!-- 编码规范 -->
                <div class="card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 p-3 rounded-full mr-4">
                                <i class="fas fa-file-code text-indigo-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">3.1 编码规范</h3>
                        </div>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                                <span>遵循良好的编码规范，避免常见的内存泄漏模式</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                                <span>使用静态分析工具（如 FindBugs 或 SonarQube）来发现潜在问题</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-2"></i>
                                <span>避免长生命周期对象引用短生命周期对象</span>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- 资源管理 -->
                <div class="card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-teal-100 p-3 rounded-full mr-4">
                                <i class="fas fa-box-open text-teal-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">3.2 资源管理</h3>
                        </div>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check text-teal-500 mt-1 mr-2"></i>
                                <span>使用 Java 7 引入的 try-with-resources 语句来自动关闭资源</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-teal-500 mt-1 mr-2"></i>
                                <span>对于高频次创建和销毁的对象，考虑使用对象池进行复用</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-teal-500 mt-1 mr-2"></i>
                                <span>谨慎使用缓存，设置合理的过期策略</span>
                            </li>
                        </ul>
                    </div>
                </div>

                <!-- 审查和测试 -->
                <div class="card bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-orange-100 p-3 rounded-full mr-4">
                                <i class="fas fa-clipboard-check text-orange-600 text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold text-gray-800">3.3 审查和测试</h3>
                        </div>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check text-orange-500 mt-1 mr-2"></i>
                                <span>定期进行代码审查，查找和修复潜在的内存泄漏问题</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-orange-500 mt-1 mr-2"></i>
                                <span>在上线前进行性能测试，模拟高并发场景</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-orange-500 mt-1 mr-2"></i>
                                <span>使用压力测试工具（如 JMeter）进行长时间测试</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>

            <!-- Checklist Visualization -->
            <div class="mt-10 bg-white rounded-xl shadow-md p-6">
                <h3 class="text-xl font-semibold text-gray-800 mb-6">内存泄漏防护检查清单</h3>
                <div class="mermaid">
                    pie
                        title 内存泄漏防护要点
                        "资源释放" : 30
                        "数据结构选择" : 20
                        "静态集合使用" : 15
                        "线程池配置" : 15
                        "垃圾回收调优" : 20
                </div>
            </div>
        </div>
    </section>

    <!-- Summary Section -->
    <section class="py-16 px-4 bg-gradient-to-r from-blue-600 to-blue-800 text-white">
        <div class="container mx-auto max-w-5xl text-center">
            <h2 class="text-3xl md:text-4xl font-bold mb-6">掌握 Tomcat 内存管理</h2>
            <p class="text-xl mb-8 max-w-3xl mx-auto opacity-90">
                通过系统的检测方法和调优策略，可以有效预防和解决 Tomcat 中的内存泄漏问题，保障应用的长期稳定运行。
            </p>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-6 max-w-4xl mx-auto">
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <i class="fas fa-tools text-3xl mb-4"></i>
                    <h3 class="text-xl font-semibold mb-2">检测工具</h3>
                    <p class="text-sm opacity-80">使用专业的工具快速定位问题</p>
                </div>
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <i class="fas fa-sliders-h text-3xl mb-4"></i>
                    <h3 class="text-xl font-semibold mb-2">参数调优</h3>
                    <p class="text-sm opacity-80">合理配置 JVM 和 Tomcat 参数</p>
                </div>
                <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm">
                    <i class="fas fa-shield-alt text-3xl mb-4"></i>
                    <h3 class="text-xl font-semibold mb-2">预防措施</h3>
                    <p class="text-sm opacity-80">良好的编码规范和定期审查</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-10 px-4">
        <div class="container mx-auto max-w-5xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-semibold text-white mb-2">技术小馆</h3>
                    <p class="text-sm">分享前沿技术知识与实践经验</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition duration-300 inline-flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-sm text-gray-500">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            pie: {
                textPosition: 0.8,
                useWidth: 900,
                useHeight: 600
            }
        });
    </script>
</body>
</html>
```